<%-- 
    Document   : capnhat-dondathang
    Created on : Dec 9, 2011, 9:26:03 PM
    Author     : BlueZky
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<link rel="stylesheet" type="text/css" href="styles/userstyles.css" />
<link rel="stylesheet" type="text/css" href="styles/simple.css" />

<c:if test="${hoaDon eq null}">
    <div class ="title">Không tim thấy đơn đặt hàng yêu cầu</div>
</c:if>

<c:if test="${hoaDon ne null}">
<div class ="title">Chi tiết đơn đặt hàng ${hoaDon.mahd}</div>
        <div class="utitle">Thông tin người nhận</div>
        <table>
            <tr>
                <td class="cell-left"><b>Tên người nhận</b></td>
                <td class="cell-right"  style="border-right: none; color: orange;"><b>${hoaDon.nguoinhan}</b></td>
            </tr>
            <tr>
                <td class="cell-left"><b>Địa chỉ </b></td>
                <td class="cell-right "  style="border-right: none; color: orange;"><b>${hoaDon.diachinhan}</b></td>
            </tr>
            <tr>
                <td class="cell-left"><b>Số điện thoại</b></td>
                <td class="cell-right "  style="border-right: none; color: orange;"><b>${hoaDon.sodtnhan}</b></td>
            </tr>
            <tr>
                <td class="cell-left"><b>CMND</b></td>
                <td class="cell-right"  style="border-right: none; color: orange;"><b>${hoaDon.cmndnhan}</b></td>
            </tr>         

        </table>
            <div class="utitle" style="margin-top: 20px;">Danh sách sản phẩm đặt mua</div>
        <div class="box">
            <c:if test="${chiTiet.size() gt 0}">
                <c:set var="sum" value="0"></c:set>
                
                <table class="utable" cellspacing="0px" cellpadding="10px" >
                    <tr>
                        <th style="width:20px;">STT</th>
                        <th>Sản phẩm</td>
                        <th style="width:50px;">Số lượng</th>
                        <th style="width:70px;">Đơn giá</th>
                        <th style="width:70px;">Khuyến mãi</th>
                        <th style="width:100px;" colspan="2">Thành tiền</th>
                    </tr>
                     <c:forEach items="${chiTiet}" var="item" varStatus="status">
                        <tr >
                            <td style="border-left: 1px #ddd solid;">${status.index + 1}</td>
                            <td><a href="chitiet.htm?PID=${item.sanpham.masp}" style="color: #00CED1;">${item.sanpham.tensp}</a></td>
                            <td>${item.soluong}</td>
                            <td style="text-align: right">${item.dongia}</td>
                            <td style="text-align: right">0</td>
                            <td colspan="2"><b>${item.soluong*item.dongia} $</b></td>
                        </tr>
                    </c:forEach>
                    <tr>
                        <td colspan="5"  style="border-left: 1px #ddd solid;text-align: center">Thành tiền</td>
                        <td colspan="2" class="ucart" style=" color: orange;">${hoaDon.tongtien} $</td>
                    </tr>
                    <tr>
                        <td colspan="5"  style="border-left: 1px #ddd solid;text-align: center">Khuyến mãi</td>
                        <td colspan="2" class="ucart" style=" color: orange;">${khuyenmai} $</td>
                    </tr>
                    <tr>
                        <td colspan="5"  style="border-left: 1px #ddd solid;text-align: center">Thanh toán</td>
                        <td colspan="2" class="ucart" style=" color: orange;">${hoaDon.tongtien - khuyenmai} $</td>
                    </tr>
                </table>
            </c:if>
        </div>
</c:if>